<?php defined('InShopNC') or exit('Access Invalid!');?>
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<?php echo SHOP_RESOURCE_SITE_URL;?>/js/gold_index.js" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/waypoints.js"></script>
<style type="text/css">
.category { display: block !important; }
.public-nav-layout{border-bottom:none !important;}
.public-nav-layout .all-category .title{ padding-bottom:8px;}
.full-screen-slides-pagination {z-index: 11;top:370px !important;}
</style>
<div class="clear"></div>
<div class="goldPage">
<!-- HomeFocusLayout Begin-->
<div class="home-focus-layout"><?php echo $output['web_html']['gold_pic'];?></div>
<!--HomeFocusLayout End-->
<!--HomeDefBz Begin-->
<div class="wrapper">
	<div class="gold-def-bz">
		<div>
		<ul>
         <?php
		 if(!empty($output['adv_list'])){
		 foreach($output['adv_list'] as $adv){ ?>
			<li><a href="<?php echo $adv['adv_url'];?>" target="_blank"><img src="<?php echo BASE_SITE_URL.DS.DIR_UPLOAD.DS.ATTACH_ADV.DS.$adv['adv_image'];?>" /></a></li>
         <?php }} ?>
		</ul>
		</div>
	</div>	

<div class="clear"></div>
<!--HomeDefBz End-->

<div class="gold-def-xianshi">
	<div class="gold-def-left">
      <div class="gold-xianshi-title"></div>
	 <div class="gold-xianshi-list">
		 <?php foreach($output['xianshi_item'] as $val) { ?>
		 <div class="gold-xianshi-item">
			 <a href="<?php echo urlShop('goods','index',array('goods_id'=> $val['goods_id']));?>"><img src="<?php echo UPLOAD_SITE_URL.DS.ATTACH_GOODS.DS.$val['goods_image'];?>">
			  <dl>
				  <dt><span><img src="<?php echo SHOP_TEMPLATES_URL;?>/images/new/clock.jpg" /> </span> 距离结束时间:<span class="time-remain" count_down="<?php echo $val['end_time']- time();?>"><i></i><em time_id="d">0</em><?php echo $lang['text_tian'];?><em time_id="h">0</em><?php echo $lang['text_hour'];?> <em time_id="m">0</em><?php echo $lang['text_minute'];?><em time_id="s">0</em><?php echo $lang['text_second'];?> </span><time></time></dt>
				  <dd class="rob-lt"><span><b><?php echo $val['goods_tag'];?></b><?php echo str_cut($val['goods_intro'],20); ?> </span><span class="right"><em>¥<?php echo(float) $val['goods_price'];?></em></span></dd>
			  </dl>
			 </a>
		 </div>
        <?php } ?>
	 </div>
	</div>
	<div class="gold-def-right">
	 <div class="hot-keyword">
      <div class="hot-title">
		  <i class="icon-list" style="color:#b2191b;font-size:18px;font-weight: normal;"></i> 热门商品
	  </div>
			<dl>
				<?php
				$hot_array = array();
				foreach($output['rec_search_list'] as $v) {
					$hot_array[] = $v['value'];
				}

				$hot_search = explode(',',$output['hj_hot_search']);
				foreach($hot_search as $val){
				?>
				<dd><a href="<?php echo urlShop('search', 'index', array('keyword' => $val));?>"><?php if(in_array($val,$hot_array)){?><b><?php }?><?php echo $val; ?><?php if(in_array($val,$hot_array)){?></b><?php }?></a></dd>
               <?php }?>
			</dl>
		</div>
		<div class="slider-right">
			<ul class="slider-photos">
			 <?php foreach($output['slider_list'] as $slider){ ?>
            <li><a href="<?php echo $slider['adv_url'];?>" target="_blank"><img src="<?php echo UPLOAD_SITE_URL.DS.ATTACH_ADV.DS.$slider['adv_image'];?>" /></a></li>
			 <?php }?>
			</ul>
		</div>
		<div class="slider-right">
			<dl>
				<dt>新品牌开售预告</dt>
			</dl>
			<dd>
				<ul class="tab-base">
				 <?php for($i=1;$i<5;$i++){?>
					<li <?php if($i==1){echo "class=\"current\"";}?> id="tab-item<?php echo $i;?>"><?php echo date('n/j',strtotime("+".$i." day"));?><br><?php echo ShowCDay($i);?></li>
				 <?php }?>
				</ul>
				<div class="tab-container">
					<?php
					   $i=1;
                      $brands_id = array();
					 foreach($output['specials'] as $special){
					 $brands_id[] = $special['brand_id'];
					?>
                   <div class="tab-<?php echo $i;?>">
					   <dl>
						   <dd><a href="<?php echo urlShop('brand', 'list', array('brand'=>$special['brand_id']));?>"><img src="<?php echo brandImage($special['brand_image']);?>" /></a></dd>
			               <dd class="title"><a href="<?php echo urlShop('brand', 'list', array('brand'=>$special['brand_id']));?>"><?php echo $special['brand_title'];?></a></dd>
					   </dl>
				   </div>
					<?php $i++; }?>
				</div>
			</dd>
		</div>

	  <div class="brands-list">
		  <ul>
			  <?php foreach($output['brands_list'] as $brand){ if(in_array($brand['brand_id'],$brands_id)||empty($brand['brand_pic2']))continue; ?>
			  <li><a href="<?php echo urlShop('brand', 'list', array('brand'=>$brand['brand_id']));?>"><img src="<?php echo brandImage($brand['brand_pic2']);?>" /></a></li>
			  <?php }?>
		  </ul>

	  </div>

	</div>

</div>
<div class="clear"></div>

<div class="gold-presale">
  <div class="gold-presale-list">
	  <div class="gold-presale-list-title"></div>
		  <ul class="gold-presale-list-container">
			  <?php
			  $i = 0;
			  foreach($output['goods_list'] as $value){ ?>
				  <li class="presale-item">
					  <a href="<?php echo urlShop('goods','index',array('goods_id'=>$value['goods_id']));?>" target="_blank" title="<?php echo $value['goods_name'];?>">
						  <img src="<?php echo UPLOAD_SITE_URL.DS.ATTACH_GOODS.DS. $value['intro_image'];?>" /></a>
						  <dl class="brd-tip">
							  <dd><h3><?php echo $value['store_name'];?></h3><h5>全场 <b><?php echo $value['intro_text'];?></b> 起</h5></dd>
						  </dl>

				  </li>
				  <?php $i++; } ?>
		  </ul>
  </div>
</div>

</div>

<div class="clear"></div>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.raty/jquery.raty.min.js"></script>
<script language="JavaScript">
	$(function(){
		$('.raty').raty({
			path: "<?php echo RESOURCE_SITE_URL;?>/js/jquery.raty/img",
			readOnly: true,
			score: function() {
				return $(this).attr('data-score');
			}
		});
	});

	/* 加入购物车后的效果函数 */
	function addcart_callback(data){
		$('#bold_num').html(data.num);
		$('#bold_mly').html(price_format(data.amount));
		$('.ncs-cart-popup').fadeIn('fast');
	}

	$(".tab-base li").mouseover(function(){
		$(".tab-base li").removeClass("current");
		$(this).addClass("current");
		id = $(this).attr("id").replace("tab-item","");
		$(".tab-container div").hide();
		$(".tab-"+id).show();
	});

</script>